package edu.scau.mis.pos.mapper;

import edu.scau.mis.pos.domain.Change;
import edu.scau.mis.pos.domain.OrderItem;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ChangeMapper {
    // 新增一条换货记录
    int insertChange(Change change);

    List<Change> selectChangeList(String changeSn, String orderId, Integer status, String startTime, String endTime, int offset, int pageSize);

    int updateChangeStatus(@Param("changeSn") String changeSn, @Param("status") Integer status);
    int updateOrderStatus(@Param("orderId") String orderId, @Param("status") Integer status);

    int deleteChangeBySn(@Param("changeSn") String changeSn);

    List<OrderItem> selectOrderDetailsByOrderId(String orderId);

    List<Change> selectAllChanges(@Param("offset") int offset, @Param("pageSize") int pageSize);

    Change selectChangeBySn(String changeSn);

    int updateChange(Change change);
}